﻿using System;
using System.Collections.Generic;
using System.Text;
using Rodunu.Movies.Interfaces.Security;
using Rodunu.Movies.Interfaces.User;
using Rodunu.Movies.Logic.User;

namespace Rodunu.Movies.Security
{
    public class UserAuthentication : IUserAuthentication
    {
        private readonly IUser _userLogic;

        public UserAuthentication()
        {
            _userLogic = new UserLogic();
        }

        #region IUserAuthentication Members

        public Rodunu.Movies.Contracts.UserInfo Authenticate(string username, string password, string ipAddress)
        {
            return _userLogic.GetByUserName(username, password);
        }

        public Rodunu.Movies.Contracts.UserInfo ReValidate(long id)
        {
            return _userLogic.Find(id);
        }

        #endregion
    }
}
